import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
} from '@nestjs/common';
import { ToyItemService } from './toy-item.service';
import { CreateToyItemDto } from './dto/create-toy-item.dto';
import { UpdateToyItemDto } from './dto/update-toy-item.dto';

@Controller('/api/toyItem')
export class ToyItemController {
  constructor(private readonly toyItemService: ToyItemService) {}

  @Post()
  create(@Body() createToyItemDto: CreateToyItemDto) {
    return this.toyItemService.create(createToyItemDto);
  }

  @Get()
  findAll() {
    return this.toyItemService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.toyItemService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateToyItemDto: UpdateToyItemDto) {
    return this.toyItemService.update(+id, updateToyItemDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.toyItemService.remove(+id);
  }
}
